<template>
	<single v-if="itemData.basic.type_code === 'single'" :itemData="itemData" @change="handleChange"></single>
	<multiple v-else-if="itemData.basic.type_code === 'multiple'" :itemData="itemData" @change="handleChange"></multiple>
	<fill v-else-if="itemData.basic.type_code === 'fill'" :itemData="itemData" @change="handleChange"></fill>
	<read-analysis v-else-if="itemData.basic.type_code === 'readAnalysis'" :itemData="itemData"></read-analysis>
</template>

<script>
	import Single from "@/components/questionSingle.vue";
	import Multiple from "@/components/questionMultiple.vue";
	import Fill from "@/components/questionFill.vue";
	import ReadAnalysis from "@/components/questionReadAnalysis.vue";
	
	export default {
		components: {
			Single, 
			Multiple,
			Fill,
			ReadAnalysis
		},
		props: {
			itemData: {
				type: Object,
				default: () => ({}),
			},
		},
		methods: {
			handleChange(e) {
				console.warn('handleChange', e);
				this.$emit('change', e);
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>